ChangeHeadersProxyModel
Base classes
| Name | Children | Inherits |
|---|---|---|
| IdentityProxyModel prettyqt.core.identityproxymodel Proxies its source model unmodified. |
â‹” Inheritance diagram
graph TD
828252285["itemmodels.ChangeHeadersProxyModel"]
527136029["core.IdentityProxyModel"]
2431222121["core.AbstractProxyModelMixin"]
3882849576["core.AbstractItemModelMixin"]
3227531497["core.ObjectMixin"]
2751680898["builtins.object"]
3668892142["QtCore.QIdentityProxyModel"]
3989152870["QtCore.QAbstractProxyModel"]
1898060022["QtCore.QAbstractItemModel"]
3984060476["QtCore.QObject"]
37984305["Shiboken.Object"]
527136029 --> 828252285
2431222121 --> 527136029
3882849576 --> 2431222121
3227531497 --> 3882849576
2751680898 --> 3227531497
3668892142 --> 527136029
3989152870 --> 3668892142
1898060022 --> 3989152870
3984060476 --> 1898060022
37984305 --> 3984060476
2751680898 --> 37984305
🛈 DocStrings
Bases: IdentityProxyModel
Proxy model for changing the header data (either horizontal or vertical).
Header data can either be changed by passing a list with same length as source length or by passing a dictionary with index as key and new value as value (Example: {1: "abc", 3: "def"} changes section 1 to "abc" and section 3 to "def") Apart from the regular use case of changing the text, the other roles can be changed, too.
Example
table.proxifier.change_headers(
header=["x", "y", "z"],
orientation=constants.HORIZONTAL,
role=constants.DISPLAY_ROLE,
)
table.show()
# or
model = MyModel()
proxy = ChangeHeadersProxyModel(
header=["x", "y", "z"], orientation=constants.VERTICAL
)
proxy.set_source_model(model)
table.set_model(proxy)
table.show()